package com.yun.zf.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yun.zf.common.admin.model.house.HouseDetailMo;
import com.yun.zf.common.admin.model.house.es.DetailEs;
import com.yun.zf.common.app.domain.ZfHouseDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 房源表 Mapper 接口
 * </p>
 *
 * @author cj
 * @since 2021-01-29
 */
@Mapper
public interface ZfHouseDetailMapper extends BaseMapper<ZfHouseDetail> {

    @Select("<script>" +
            "  SELECT  zd.basic_id, zd.hoped_price, zd.exhaust_price ,zd.area, zd.bedrooms ,zd.living_room ,zd.toilet,zd.floor ,zd.total_floor  ,zd.direction,zd.is_elevator ,zd.title " +
            " from zf_house_detail zd WHERE   zd.basic_id=#{houseId} and zd.city_code=#{cityCode} and zd.province_code=#{provCode}  " +
            "</script>")
    public HouseDetailMo getDetail(Long houseId, Long provCode, Long cityCode);


    @Select("<script>" +
            " SELECT hd.hoped_price,hd.area,hd.bedrooms,hd.floor,hd.floor_tag,hd.direction,hd.is_elevator,hd.house_number,hd.price_unit,hd.title from zf_house_detail hd  " +
            "WHERE  hd.basic_id=#{houseId} and  hd.city_code=#{cityCode} and hd.province_code=#{provCode}  " +
            "</script>")
    DetailEs  detailToEs(Long houseId, Long provCode, Long cityCode);
}
